import { getCartList } from "@/api/cart"
export default {
    namespaced: true,
    state () {
      return {
        cartList: []
      }
    },
    mutations: {
        setCartList (state, newList) {
          state.cartList = newList
        },
      },
      actions: {
        async getCartAction (context) {
          const { data } = await getCartList()
          data.list.forEach(item => {
            item.isChecked = true
          })
          context.commit('setCartList', data.list)
        }
      },
    getters: {
    }
  }